using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using ZooApplication.Library;

namespace ZooApplication.Website
{
    public partial class Login : System.Web.UI.Page, ZooApplication.Library.ILoginView
    {
        private LoginControler controler;

        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            ILoginModel model = new LoginModel();
            controler = new LoginControler(this, model);
        }
        protected void Page_Load(object sender, EventArgs e)
        {
            controler.Initialize();
        }

        public string EmailAddress
        {
            get
            {
                return TxbEmailAddress.Text;
            }
            set
            {
                TxbEmailAddress.Text = value;
            }
        }

        public string ErrorMessage
        {
            get
            {
                return LblErrorMsg.Text;
            }
            set
            {
                LblErrorMsg.Text = value;
            }
        }

        public string Password
        {
            get
            {
                return TxbPassword.Text;
            }
            set
            {
                TxbPassword.Text = value;
            }
        }

        public Button BtnLogin
        {
            get
            {
                return PageBtnLogin;
            }
            set
            {
                PageBtnLogin = value;
            }
        }

        public void RedirectFromLoginPage()
        {
            FormsAuthentication.RedirectFromLoginPage(this.EmailAddress, false);
        }
    }
}
